#include <head.h>
// 读取管道内的数据

int main(int argc, char const *argv[])
{
    int fd = open("my_fifo" , O_RDONLY);
    OPEN_ERR(fd);

    printf("读端\n");
    char buf_read[128];
    
    while (1)
    {
        memset(buf_read , 0 , sizeof(buf_read));
        read(fd , buf_read , sizeof(buf_read));
        if (strlen(buf_read) == 0)
        {
            continue;
        }
        if (!strcmp( buf_read , "quit" ))
        {
            printf("读端 退出\n");
            break;
        }
        printf("读取:%s\n" , buf_read);
    }

    
    close(fd);

    return 0;
}



